package com.sskj.uboex.ui.fragment;


import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.sskj.common.rxbus2.RxBus;
import com.sskj.common.rxbus2.Subscribe;
import com.sskj.common.rxbus2.ThreadMode;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseFragment;
import com.sskj.lib.bean.StockCoinBean;
import com.sskj.uboex.R;
import com.sskj.uboex.bean.ProfileRefreshBean;
import com.sskj.uboex.presenter.ProfileFragmentPresenter;

import butterknife.BindView;

@Route(path = RConfig.APP_FRAGMENT_PROFILE)
public class ProfileFragment extends BaseFragment<ProfileFragmentPresenter> {
    @BindView(R.id.tvFirst)
    TextView tvFirst;
    @BindView(R.id.tvSecond)
    TextView tvSecond;
    @BindView(R.id.tvThird)
    TextView tvThird;
    @BindView(R.id.tvFour)
    TextView tvFour;
    @BindView(R.id.tvFive)
    TextView tvFive;
    @BindView(R.id.tvContent)
    TextView tvContent;

    @Override
    protected int getLayoutId() {
        return R.layout.app_fragment_profile;
    }

    @Override
    public ProfileFragmentPresenter getPresenter() {
        return new ProfileFragmentPresenter();
    }

    @Override
    public void initView() {
        RxBus.getDefault().register(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void refresh(ProfileRefreshBean profileRefreshBean) {
        StockCoinBean stockCoinBean = profileRefreshBean.getStockCoinBean();

        tvFirst.setText(stockCoinBean.getCreateTime());
        tvSecond.setText(stockCoinBean.getPublishNum());
        tvThird.setText(stockCoinBean.getPublishPrice());
        tvFour.setText(stockCoinBean.getWhitePaper());
        tvFive.setText(stockCoinBean.getPublishWeb());
        tvContent.setText(stockCoinBean.getRemark());
    }


}
